package com.fottas.adware.common.api;

/**
 * 封装API的错误码
 */
public class IErrorCode {

    //常用API操作码
    public static final ResultCode SUCCESS = createCodeMessage("200", "操作成功");
    public static final ResultCode FAILED = createCodeMessage("500", "系统异常");
    public static final ResultCode VALIDATE_FAILED = createCodeMessage("404", "参数检验失败");
    public static final ResultCode UNAUTHORIZED = createCodeMessage("401", "暂未登录或token已经过期");
    public static final ResultCode FORBIDDEN = createCodeMessage("403", "没有相关权限");
    public static final ResultCode AUTH_CODE_FAILED = createCodeMessage("405", "验证码错误");
    public static final ResultCode ALIPAY_PAY_FAILED = createCodeMessage("1001", "支付宝支付失败");
    public static final ResultCode PAY_TYPE_FAILED = createCodeMessage("1002", "该二维码类型暂未实现");

    public static ResultCode createCodeMessage(String code, String message) {
        return new ResultCode(code, message);
    }
}
